﻿import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Layouts 1.12
import QtQuick.Controls 2.14
import "./components"

Window {
    id:splashScreenRoot
    width: 1280*dp
    height: 800*dp
    objectName: "mainView"
    visible: true
    flags: Qt.Window | Qt.FramelessWindowHint
    readonly property real dp: config.dp
    signal hided()
    Config{
        id: config
    }

    Image {
        anchors.fill: parent
        source: "qrc:/picture/start_pic.jpg"
    }
    Rectangle{
        anchors.fill: parent
        color: "transparent"
        Text {
            x:472*dp
            y:230*dp
            width: 700*dp
            height: 70*dp
//            verticalAlignment: Text.AlignVCenter
//            horizontalAlignment: Text.AlignHCenter
            text: qsTr("EZ Studio ")
            font.pixelSize: 80
            color: "#404485"
            font.bold: true
        }
        Text {
            x:600*dp
            y:350*dp
            width: 100*dp
            height: 70*dp
            text: qsTr("v1.1")
            font.pixelSize: 50
            color: "#404485"
//            font.bold: true
        }
        Text {
            x:580*dp
            y:560*dp
            width: 120*dp
            height: 70*dp
            text: qsTr("正在加载")
            font.pixelSize: 30
            color: "#404485"
//            font.bold: true
        }
        CustomAnimatedImage {
            id: gifComponent
            x:700*dp
            y:580*dp
            source: "qrc:/picture/load.gif"  // GIF文件路径
            width: 20*dp
            height: 20*dp
            speed: 1

            // 动画控制
            playing: true    // 是否播放（默认true）
        }

        Text {
            x:437*dp
            y:parent.height-80*dp
            width: 400*dp
            height: 40*dp
            text: qsTr("© 2025-2026 Bio-Raychip All Rights Reserved")
            font.pixelSize: 20
            color: "#404485"
        }
    }


    Timer{
        id:splashScreenQuitTime
        interval: 2500
        running: true
        repeat: true
        onTriggered: splashScreenQuit()
    }

    function splashScreenQuit() {
        splashScreenRoot.visible=false
        close()
        hided()
    }
}

